cmake_minimum_required(VERSION 3.12.4)

project(helloworld)

# 添加源文件
file(GLOB src_files src/*.c)


# 生成可执行文件
add_executable(helloworld ${src_files})

target_link_libraries(${PROJECT_NAME} PRIVATE tslib)

target_link_libraries(helloworld PRIVATE lvgl)
target_include_directories(helloworld PRIVATE lvgl)

target_link_libraries(helloworld PRIVATE lvgl_examples)
target_include_directories(helloworld PRIVATE lvgl_examples)

target_link_libraries(helloworld PRIVATE lvgl_demos)
target_include_directories(helloworld PRIVATE lvgl_demos)

target_link_libraries(helloworld PRIVATE lv_drivers)
target_include_directories(helloworld PRIVATE lv_drivers)

# 设置RPATH相关属性
set_target_properties(${PROJECT_NAME} PROPERTIES
    INSTALL_RPATH "$ORIGIN/../lib"
    BUILD_WITH_INSTALL_RPATH TRUE
    SKIP_BUILD_RPATH FALSE
)

# 设置编译输出目录
set_target_properties(${PROJECT_NAME} PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

install(TARGETS helloworld
	RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")



